package com.zt.ztzx.controller;

import com.github.pagehelper.PageInfo;
import com.zt.ztzx.model.entity.product.ProductBatches;
import com.zt.ztzx.model.entity.product.TTask;
import com.zt.ztzx.model.vo.common.Result;
import com.zt.ztzx.model.vo.product.TaskVo;
import com.zt.ztzx.service.TTaskService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("task")
public class TaskController {

    @Autowired
    private TTaskService taskService;

    @GetMapping("/findAll/{pageNum}/{pageSize}")
    @Operation(summary = "农事任务列表", description = "农事任务列表",method = "findAll方法")
    @Parameters({
            @Parameter(name = "pageNum",description = "当前页码",required = true),
            @Parameter(name = "pageSize",description = "每页显示条数",required = true)
    })
    public Result<PageInfo<TaskVo>> findAll(@PathVariable("pageNum")Integer pageNum, @PathVariable("pageSize")Integer pageSize) {
        return taskService.findAll(pageNum,pageSize);
    }
}
